#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(this,&Widget::mysigngal,this,&Widget::handlesignal);
    connect(ui->pushButton_3,&QPushButton::clicked,this,&Widget::close1);
    connect(ui->pushButton_4,&QPushButton::clicked,this,[](){
        qDebug()<<"log";
    });
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    emit mysigngal();
}

void Widget::handlesignal()
{
    this->setWindowTitle("标题更改");
}

void Widget::handlesignal1()
{
    this->setWindowTitle("标题更改2");
}

void Widget::close1()
{
    this->close();
}


void Widget::on_pushButton_2_clicked()
{
    disconnect(this,&Widget::mysigngal,this,&Widget::handlesignal);
    connect(this,&Widget::mysigngal,this,&Widget::handlesignal1);
}




